using System.Collections.Generic;
using FadeLang.Ast;
using FadeLang.Runtime;

namespace FadeLang.CstVisitor
{
    public class ArgListVisitor : FadeLangBaseVisitor<List<Exp>>
    {
        private readonly Context context;

        public ArgListVisitor(Context context) {
            this.context = context;
        }

        public override List<Exp> VisitArgList(FadeLangParser.ArgListContext context) {
            var list = new List<Exp>();
            var expVisitor = new ExpVisitor(this.context);
            foreach (var expContext in context.exp()) {
                var exp = expVisitor.VisitExp(expContext);
                list.Add(exp);
            }
            return list;
        }
    }
}